#pragma once

#include <typeinfo>

namespace SG
{

	class Type
	{
	public:
		Type() noexcept
			:m_Type(nullptr) {}
		Type(const std::type_info& info) noexcept
			:m_Type(&info) {}
		Type(const Type& type) noexcept
			:m_Type(type.m_Type) {}
		~Type() = default;

		bool operator==(const Type& rhs)
		{
			size_t lhsPtr = (size_t)m_Type;
			size_t rhsPtr = (size_t)rhs.m_Type;

			if ((lhsPtr & rhsPtr) == 0)
			{
				return !(lhsPtr | rhsPtr);
			}
			return *m_Type == *rhs.m_Type;
		}
	private:
		const std::type_info const* m_Type;
	};

}